
#include "display.h"

void DrawScreen(Creature &P) {
    DrawMainBattle();
    DrawMainStat(P);
    DrawBWidget();
}

void DrawMainBattle() {
    wclear(win[S_MAINBATTLE]);
    int logsize = Log1.size();
    if (logsize == 0) {

    } else {
        for (int i = 1; i <= 10; i++) {
            if ((logsize - i) < 0) {

            } else {
                mvwaddstr(win[S_MAINBATTLE], (i - 1), 0, PrintLog1(logsize - i));
            }
        }
    }
    wrefresh(win[S_MAINBATTLE]);
}

void DrawMainStat(Creature &Pl) {

    wclear(win[S_MAINSTAT]);

    col(S_MAINSTAT, 2);
    mvwprintw(win[S_MAINSTAT], 0, 0, "Str: %d", Pl.Str);


    mvwprintw(win[S_MAINSTAT], 1, 0, "Dex: %d", Pl.Dex);

    mvwprintw(win[S_MAINSTAT], 2, 0, "Int: %d", Pl.Int);
    mvwprintw(win[S_MAINSTAT], 3, 0, "End: %d", Pl.Endu);
    mvwprintw(win[S_MAINSTAT], 4, 0, "HP: %d/%d", Pl.hp, Pl.HPMAX);

    wrefresh(win[S_MAINSTAT]);
}

void DrawBWidget() {

    wclear(win[S_BWIDGET]);

    int size = 5;
    const char* str[size]; // str2, str3;

    str[0] = " o o o\n";
    str[1] = "  \\|/ \n";
    str[2] = "o--0--o\n";
    str[3] = "  /|\\ \n";
    str[4] = " o o o\n";

    for (int i = 0; i < size; i++) {
        waddstr(win[S_BWIDGET], str[i]);
    }

    mvwchgat(win[S_BWIDGET], 0, 3, 1, A_BOLD, 4, NULL);
    //waddch(win[S_BWIDGET], str[0][3]);
    wrefresh(win[S_BWIDGET]);
}

void DrawHelp() {
    erase();
    mvprintw(5, 5, "Some help here");
    mvprintw(6, 5, "and here too.");
    refresh();
    getch();

}